package imoocvideodev.controller;

import imoocvideodev.common.result.IMoocJSONResult;
import imoocvideodev.pojo.BGM;
import imoocvideodev.service.BgmService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author: Redi
 * @Date: 2021/2/6 20:41
 * @Description: bgm控制器
 */
@Api(value = "用户选择背景音乐的接口",tags = {"用户选择背景音乐的controller"})
@RestController
@RequestMapping("/bgm")
public class BgmController extends BasicController{

    @Autowired
    BgmService bgmService;

    @ApiOperation(value = "获取所有背景音乐",notes = "获取所有背景音乐的接口")
    @PostMapping("/list.do")
    public IMoocJSONResult getAllBgm() {
        List<BGM> bgmList = bgmService.getAllBgm();
        return IMoocJSONResult.okData(bgmList);
    }
}
